package com.battle.service.controller.web;

import com.battle.pojo.param.casePatrolStation.*;
import com.battle.pojo.vo.casePatrolStation.*;
import com.battle.service.service.in.*;
import nirvana.core.domains.vo.PageResult;
import nirvana.core.domains.vo.ApiResult;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

import java.util.List;

/**
*   web/站巡处-战例详情
* 【描 述】：
* 【环 境】：J2SE
* 【详 细】：
*
*/
@RestController
@RequestMapping("/casePatrolStation/web")
public class CasePatrolStationWebController {

private final CasePatrolStationService service;

public CasePatrolStationWebController(CasePatrolStationService service) {
this.service = service;
}


/**
* 创建站巡处-战例详情
* @param param
* @return
*/
@PostMapping("/createCasePatrolStation")
public ApiResult createCasePatrolStation(@RequestBody @Valid CreateCasePatrolStationParam param){
service.createCasePatrolStation(param);
return ApiResult.ok();
}


/**
* 修改站巡处-战例详情
* @param param
*/
@PutMapping("/editCasePatrolStation")
public ApiResult editCasePatrolStation(@RequestBody @Valid EditCasePatrolStationParam param){
service.editCasePatrolStation(param);
return ApiResult.ok();
}

/**
* 移除站巡处-战例详情
* @param id
*/
@DeleteMapping("/removeCasePatrolStation")
public ApiResult removeCasePatrolStation(@RequestParam("id") Long id){
service.removeCasePatrolStation(id);
return ApiResult.ok();
}

/**
* 启动/禁用站巡处-战例详情
* @param id
*/
@GetMapping("/enabledCasePatrolStation")
public ApiResult enabledCasePatrolStation(@RequestParam("id") Long id){
service.enabledCasePatrolStation(id);
return ApiResult.ok();
}

/**
* 获取站巡处-战例详情详情
* @param id
* @return
*/
@GetMapping("/getCasePatrolStation")
public ApiResult< GetCasePatrolStationVo> getCasePatrolStation(@RequestParam("id") Long id){
GetCasePatrolStationVo vo = service.getCasePatrolStation(id);
return ApiResult.ok(vo);
}

/**
* 获取站巡处-战例详情列表
* @param param
* @return
*/
@PostMapping("/getCasePatrolStationList")
public ApiResult< PageResult< GetCasePatrolStationListVo>> getCasePatrolStationList(@RequestBody GetCasePatrolStationListParam param){
PageResult< GetCasePatrolStationListVo> result = service.getCasePatrolStationList(param);
return ApiResult.ok(result);
}


/**
* 获取站巡处-战例详情下拉列表
*
* @return
*/
@PostMapping("/getCasePatrolStationDownList")
public ApiResult< List< GetCasePatrolStationDownListVo > > getCasePatrolStationDownList(@RequestBody(required = false) @Valid GetCasePatrolStationDownListParam param) {
List< GetCasePatrolStationDownListVo > list = service.getCasePatrolStationDownList(param);
return ApiResult.ok(list);
}


}

